#ifndef INC_CAMERA_H_
#define INC_CAMERA_H_

#include <d3dx9.h>

class TCamera {

	// View 
	D3DXVECTOR3   position;
	D3DXVECTOR3   target;
	D3DXVECTOR3   aux_up;
	float		  distance_to_target;
	D3DXMATRIX    view;			// 

//	D3DXQUATERNION orientation;	// 
//	float yaw, pitch, roll;		// Euler angles

	// Prespective parameters
	float         fov_in_radians;	// Vertical fov
	float         aspect_ratio;
	float         z_near;
	float         z_far;
	D3DXMATRIX    projection;

public:

	TCamera();

	// View 
	void lookAt( const D3DXVECTOR3 &src
		       , const D3DXVECTOR3 &dst
		       , const D3DXVECTOR3 &aux
			   );

	const D3DXVECTOR3& getPosition()   const { return position;   }
	const D3DXVECTOR3& getTarget()     const { return target;     }
	const D3DXMATRIX&  getView()       const { return view;       }
	const D3DXMATRIX&  getProjection() const { return projection; }
	float getDistanceToTarget()        const { return distance_to_target; }

	// Proj
	void  setProjectionParams( float new_fov_in_radians
		                     , float new_aspect_ratio
		                     , float new_z_near, float new_z_far
							 );
	float getZNear( ) const { return z_near; }
	float getZFar( ) const  { return z_far; }
	float getAspectRatio( ) const  { return aspect_ratio; }
	float getFov( ) const   { return fov_in_radians; }

};

#endif

